<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
	<title>Javascripts &raquo; Tree</title>
	<script type="text/javascript" src="jquery.min.js"></script>
	<script type="text/javascript" src="dtree.js"></script>
	<style>
		.dtree {
			font-family: 宋体;
			font-size: 12px;
			color: #666;
			white-space: nowrap;
		}
		.dtree img {
			border: 0px;
			vertical-align: middle;
		}
		.dtree a {
			color: #333;
			text-decoration: none;
		}
		.dtree a.node, .dtree a.nodeSel {
			white-space: nowrap;
			padding: 1px 2px 1px 2px;
		}
		.dtree a.node:hover, .dtree a.nodeSel:hover {
			color: #333;
			text-decoration: underline;
		}
		.dtree a.nodeSel {
			background-color: #c0d2ec;
		}
		.dtree .clip {
			overflow: hidden;
		}
	</style>
	<script type="text/javascript">
	function test() {
		alert("test");
	}		
	</script>
</head>

<body>
<h2>Example</h2>

<div id="dtree" class="dtree">
	<script type="text/javascript">
		<!--
		d = new dTree('d');
		
		d.add(0,-1,'单位管理');
		var zgs = new Node(1,0,'总公司','javascript:test();');
		zgs._hc = false; //有子节点
		d.aNodes[d.aNodes.length] = zgs; //加入到树
		
		var yfzx = new Node(2,0, '研发中心');
		yfzx._hc = true;
		d.aNodes[d.aNodes.length] = yfzx;
		
		var gcb = new Node(3,0,'工程部');
		gcb._hc = true;
		d.aNodes[d.aNodes.length] = gcb;
		
		document.write(d);
		//-->
	</script>
</div>
</body>
</html>